package com.yungu.swift.demo.dt.crtl;

import com.yungu.swift.base.ResponseData;
import com.yungu.swift.demo.dt.model.DemoDt1;
import com.yungu.swift.demo.dt.service.DemoDt1Service;
import com.yungu.swift.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : cuixiuyin
 * @date : 2019/9/7
 */
@RestController
@RequestMapping("/test")
public class DemoDt1Crtl {

    @Autowired
    private DemoDt1Service demoDt1Service;

    @RequestMapping("/demoDt1")
    public ResponseData<Void> demoDt1() {
        DemoDt1 demoDt1 = new DemoDt1();
        demoDt1.setId(StringUtils.buildUUID());
        demoDt1.setTname("Tname");
        demoDt1Service.add(demoDt1);
        return ResponseData.buildSuccessResponse(null);
    }
}
